<!--
 * @Descripttion : 
 * @Autor        : Lilong
 * @Date         : 2022-09-14 10:59:33
 * @LastEditTime : 2022-09-14 12:10:23
 * @FilePath     : \src\App.vue
-->
<template>
  <div id="app">
    <h1>父组件</h1>
    <div>{{ message }}</div>
    <child-component @sendMsg="getChildMsg"></child-component>
  </div>
</template>

<script>
import ChildComponent from './ChildComponent'
export default {
  name: 'App',
  data(){
    return{
      message:''
    }
  },
  methods:{
    getChildMsg(msg){
      console.log(msg)
      this.message = msg // 这是父组件接收到的消息
    }
  },
  mounted() {
  },
  components:{
    ChildComponent
  }
}
</script>

<style>
</style>
